﻿using System;
using jSLCore.Client.Presentation.BaseControl.Selection;

namespace jSLApp.Client.Forms
{
    public partial class PaymentModuleList : SelectControl
    {
        public PaymentModuleList()
        {
            InitializeComponent();
        }

        public override ISelectableGrid GetSelectableGrid()
        {
            return grid;
        }

        public override void LoadInitialData()
        {
            DoWork("Загрузка платежных систем",(sender, args) =>
                                                   {
                                                       args.Result = Communication.Proxy.GetPaymentModules();
                                                   },(o, eventArgs) =>
                                                                         {
                                                                             if(eventArgs.Error==null)
                                                                             {
                                                                                 grid.ItemsSource = eventArgs.Result;
                                                                             }
                                                                         });
        }
    }
}
